//
//  DSstatesListModel.swift
//  weibo
//
//  Created by JonsonLiu on 2017/3/10.
//  Copyright © 2017年 JonsonLiu. All rights reserved.
//

import UIKit

class DSstatesListModel: NSObject {

    
    func loadData(finised: @escaping (_ isSuccess: Bool) -> ()) {
        
        let url = "https://api.weibo.com/2/statuses/home_timeline.json"
        let param = [
            "access_token": "2.00VbzG3CbZxgeBafd89365faJgnK_B"
        ]
        NetworkTools.shardTools.request(method: .Get, urlString: url, parameters: param as AnyObject?) { (responseObject, error) in
            
            if error != nil {
                
                print(error!)
                return
            }
            
            guard let dicts = responseObject as? [String : AnyObject] else{
                return
            }
            guard let dict = dicts["statuses"] as? [String : AnyObject] else{
                return
            }
            
            finised(true)
            //            self.tableView.reloadData()
        }
    }

    
}
